#include <stdio.h>
int main(void)
{
    int mm1, dd1, yy1;
    int mm0 = 12, dd0 = 31, yy0 = 99;
    for (;;) {
        printf("Enter a date (mm/dd/yy): ");
        scanf("%d/%d/%d", &mm1, &dd1, &yy1);
        if (mm1 == 0 && dd1 == 0 && yy1 == 0)
            break;

        if (yy1 < yy0) {
            yy0 = yy1;
            mm0 = mm1;
            dd0 = dd1;
            continue;
        }
        if (yy0 < yy1) {
            continue;
        }
        if (mm1 < mm0) {
            yy0 = yy1;
            mm0 = mm1;
            dd0 = dd1;
            continue;
        }
        if (mm0 < mm1) {
            continue;
        }
        if (dd1 < dd0) {
            yy0 = yy1;
            mm0 = mm1;
            dd0 = dd1;
            continue;
        }
        if (dd0 < dd1) {
            continue;
        }
    }
    printf("%d/%d/%.2d is the earliest date\n", mm0, dd0, yy0);
    return 0;
}